package com.itheima05;

import java.util.Collections;
import java.util.LinkedList;

/**
 * @author Xiao
 * @date 2021/7/25
 */
public class LinkedListDemo01 {
    /**
     * LinkedListDemo
     */
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        Collections.addAll(list, "aaa", "bbb", "ccc");
        System.out.println(list);
        System.out.println("-----------");
        list.addFirst("123");
        list.addLast("456");
        System.out.println(list);
        System.out.println("-----------");
        System.out.println(list.getFirst());
        System.out.println(list.getLast());
        System.out.println("-----------");
        System.out.println(list.removeFirst());
        System.out.println(list.removeLast());
        System.out.println("-----------");
        System.out.println(list);


    }
}
